package springx.uitils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
//序列化
@NoArgsConstructor
@AllArgsConstructor
public class res {
    private long code;
    private String msg;
    private Object obj;

    //成功返回
    public static res success(String msg){
        return  new res(200,msg,null);
    }
    //成功返回
    public static res success(String msg,Object obj){
        return  new res(200,msg,obj);
    }
    //失败返回
    public  static  res  error(String msg){
        return  new res(500,msg,null);
    }
    //失败返回
    public  static  res error(String msg,Object obj){
        return  new res(500,msg,obj);
    }
}
